#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
int main()
{
	char ch[256] = { 0 };
	scanf("%s", ch);
	int count_boy = 0;
	int count_girl = 0;
	char* p = NULL;
	while (1)
	{
		p = strstr(ch, "boy");
		if (!p)break;
		memset(p, '.', 3);
		count_boy++;
	}
	while (1)
	{
		p = strstr(ch, "girl");
		if (!p)break;
		memset(p, '.', 4);
		count_girl++;
	}
	while (1)
	{
		p = strstr(ch, "oy");
		if (!p)break;
		memset(p, '.', 2);
		count_boy++;
	}
	while (1)
	{
		p = strstr(ch, "bo");
		if (!p)break;
		memset(p, '.', 2);
		count_boy++;
	}
	while (1)
	{
		p = strstr(ch, "b");
		if (!p)break;
		memset(p, '.', 1);
		count_boy++;
	}
	while (1)
	{
		p = strstr(ch, "o");
		if (!p)break;
		memset(p, '.', 1);
		count_boy++;
	}
	while (1)
	{
		p = strstr(ch, "y");
		if (!p)break;
		memset(p, '.', 1);
		count_boy++;
	}

	while (1)
	{
		p = strstr(ch, "gir");
		if (!p)break;
		memset(p, '.', 3);
		count_girl++;
	}
	while (1)
	{
		p = strstr(ch, "irl");
		if (!p)break;
		memset(p, '.', 3);
		count_girl++;
	}
	while (1)
	{
		p = strstr(ch, "rl");
		if (!p)break;
		memset(p, '.', 2);
		count_girl++;
	}
	while (1)
	{
		p = strstr(ch, "ir");
		if (!p)break;
		memset(p, '.', 2);
		count_girl++;
	}
	while (1)
	{
		p = strstr(ch, "gi");
		if (!p)break;
		memset(p, '.', 2);
		count_girl++;
	}
	while (1)
	{
		p = strstr(ch, "g");
		if (!p)break;
		memset(p, '.', 1);
		count_girl++;
	}
	while (1)
	{
		p = strstr(ch, "i");
		if (!p)break;
		memset(p, '.', 1);
		count_girl++;
	}
	while (1)
	{
		p = strstr(ch, "r");
		if (!p)break;
		memset(p, '.', 1);
		count_girl++;
	}
	while (1)
	{
		p = strstr(ch, "l");
		if (!p)break;
		memset(p, '.', 1);
		count_girl++;
	}
	printf("%d\n%d\n", count_boy, count_girl);
	return 0;
}
